package passwordCheckerPrimeiraIteracao.testes;

import static org.junit.Assert.*;

import java.lang.reflect.Array;
import java.util.Arrays;
import java.util.Collection;

import javax.xml.ws.soap.Addressing;

import org.junit.Assume;
import org.junit.Before;
import org.junit.Test;
import org.junit.experimental.theories.DataPoints;
import org.junit.experimental.theories.Theories;
import org.junit.experimental.theories.Theory;
import org.junit.runner.RunWith;
import org.junit.runners.Parameterized;

import passwordCheckerPrimeiraIteracao.PasswordCheckerBasePrimeiraIteracao;

@RunWith(Parameterized.class)
public class SymbolCounterTest {
	private Integer numberOfSymbols;
	private String inputPassword;

	public SymbolCounterTest(String pInputPassword, Integer pNumberOfSymbols) {
		this.inputPassword = pInputPassword;
		this.numberOfSymbols = pNumberOfSymbols;
	}

	@Parameterized.Parameters
	public static Collection symbolValidation() {
		return Arrays.asList(new Object[][] { { "Luiz!@#", 3 }, { "Luiz", 0 },
				{ "!Luiz", 1 }, { "Lu!@#iz", 3 }, { "!@#$", 4 } });
	}

	@Test
	public void SymbolValidation() {
		assertEquals(Integer.valueOf(numberOfSymbols),
				Integer.valueOf((PasswordCheckerBasePrimeiraIteracao
						.symbolCounter(inputPassword))));
	}
}
